#!/bin/bash

# project_path=$(cd `dirname $0` && cd .. ;pwd)
project_path=`pwd`
scp_remote_str="vagrant@192.168.10.10"
remote_project_location="~/scptest"

function checkParam(){
    if [ ! -n $1 ];then
        echo "缺少参数";exit;
    fi
}

checkParam

first_param=$1

function formatParam() {
    if [ ${first_param:0:2} == "./" ];then
        first_param=${first_param:2}
    fi
}

file=$first_param

if [ ! -d $project_path/$file ];then
    scp  $project_path/$file $scp_remote_str:$remote_project_location/$file
else
    scp -r $project_path/$file $scp_remote_str:$remote_project_location/$file
fi


